<?php
  require_once('tpl/header.php');
?>

  <?php 
  //连接数据库，接收参数uid，写删除的sql语句。
  /*mysql_connect("localhost","root","");
  mysql_select_db("neuvideo");
  mysql_query("set names utf8");*/

  // require('../system/dbConn.php');
  connect();

  //接收uid参数，接收userList页传来的uid参数
  $uid=$_GET["uid"];

  //sql
  $sql="delete from users where uid=$uid";
  $sql1="select pic from users where uid=$uid";
  $result=mysql_query("$sql1");
  $picname=mysql_fetch_assoc($result);
  unlink("../images/".$picname['pic']);
  $result=mysql_query($sql);//$result是整型
  if ($result==1) {
    echo "删除成功，三秒后返回用户列表页";
    header("refresh:3;url='userList.php'");
      }else{
        echo "删除失败";
      }
      
   ?> 


<?php
  require_once('tpl/footer.php');
?>